{% extends "base.html" %}

{% block title %}{{ block.super }} - Group Details{% endblock %}

{% block content %} 
<article class="i">
	<p class="iTtl">{{ group.name }}</p>
	<p class="iTtl">{{ group.project.name|default:"No project chosen" }}</p>
	{% if admin or user == group.owner %}
	<p class="iTtl">
		<a href="/groups/{{ group.key }}/edit">Moderate this group</a>
	</p>
	{% endif %}
	{% if user and not user.in_group %}
	<p class="iTtl">
		<a href="/groups/{{ group.key }}/join">Join this group</a>
	</p>
	{% endif %}
	{% if user.group == group and user != group.owner %}
	<p class="iTtl">
		<a href="/groups/{{ group.key }}/leave">Leave this group</a>
	</p>
	{% endif %}
	{% if group.submissions.get %}
	<h3>Submissions</h3>
		<ul>
			{% for submission in group.submissions %}
			<li><a href="{{ submission.url }}">{{ submission.text}}</a></li>
			{% endfor %}
		</ul>
	{% endif %}
	<h3>Group Members</h3>
	<ul>
		{% for member in group.members %}
		<li>{{ member.nickname }}</li>
		{% endfor %}
	</ul>
</article>
{% endblock %}
